package org.wangle.seckill.mq.ack;

import lombok.extern.slf4j.Slf4j;
import org.springframework.amqp.rabbit.connection.CorrelationData;
import org.springframework.amqp.rabbit.core.RabbitTemplate;

@Slf4j
public class ConfirmCallBackHandler implements RabbitTemplate.ConfirmCallback {
    @Override
    public void confirm(CorrelationData correlationData, boolean ack, String cause) {
        if(ack){
            log.info("消息发送-消息发送到交换器：correlationData({}),ack({}),cause({})",correlationData, true,cause);
        }else{
            log.info("消息发送-消息无法发送到交换器：correlationData({}),ack({}),cause({})",correlationData, true,cause);
        }
    }
}
